package com.mes.cloud.service;

import com.mes.cloud.dao.*;
import com.mes.cloud.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 业务菜单的操作日志公共类
 */
@Service
public class LogService {

    private SysOrganizationLogDao sysOrganizationLogDao;

    private SysPositionLogDao sysPositionLogDao;

    private SysEmployeeLogDao sysEmployeeLogDao;

    private SysAreaLogDao sysAreaLogDao;

    private ProductLogDao productLogDao;

    @Autowired
    public LogService(SysOrganizationLogDao sysOrganizationLogDao,
                      SysPositionLogDao sysPositionLogDao,
                      SysEmployeeLogDao sysEmployeeLogDao,
                      SysAreaLogDao sysAreaLogDao,
                      ProductLogDao productLogDao) {
        this.sysOrganizationLogDao = sysOrganizationLogDao;
        this.sysPositionLogDao = sysPositionLogDao;
        this.sysEmployeeLogDao = sysEmployeeLogDao;
        this.sysAreaLogDao = sysAreaLogDao;
        this.productLogDao = productLogDao;
    }

    /**
     * 插入组织操作日志
     *
     * @param sysOrganizationLog
     * @return
     */
    int insertOrganizationLog(SysOrganizationLog sysOrganizationLog) {
        return sysOrganizationLogDao.insertSelective(sysOrganizationLog);
    }

    /**
     * 插入岗位操作日志
     *
     * @param sysPositionLog
     * @return
     */
    int insertPositionLog(SysPositionLog sysPositionLog) {
        return sysPositionLogDao.insertSelective(sysPositionLog);
    }

    /**
     * 插入行政区划操作日志
     *
     * @param sysAreaLog
     * @return
     */
    int insertAreaLog(SysAreaLog sysAreaLog) {
        return sysAreaLogDao.insertSelective(sysAreaLog);
    }

    /**
     * 插入员工操作日志
     *
     * @param sysEmployeeLog
     * @return
     */
    int insertEmployeeLog(SysEmployeeLog sysEmployeeLog) {
        return sysEmployeeLogDao.insertSelective(sysEmployeeLog);
    }


    /**
     * 插入产品操作日志
     *
     * @param productLog
     * @return
     */
    int insertProductLog(ProductLog productLog) {
        return productLogDao.insertSelective(productLog);
    }

}
